package com.azt.api.dto.member;

import org.apache.commons.lang3.StringUtils;

import java.util.Arrays;
import java.util.List;

/**
 * 集采检索条件
 * Created by 张栋 on 2017/2/1410:47
 */
public class MemberParam {

    private String categoryIds;//","号分割
    private String provinceCode;//省code,
    private String cityCode;//市code,

    private Integer pageNo = 1;
    private Integer pageSize = 10;

    public String getCategoryIds() {
        return categoryIds;
    }

    public void setCategoryIds(String categoryIds) {
        this.categoryIds = categoryIds;
    }


    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public List<String> getCategoryList(){
        String categoryIds = getCategoryIds();
        if(StringUtils.isNotBlank(categoryIds)){
            String[] split = categoryIds.split(",");
            return Arrays.asList(split);
        }else{
            return null;
        }
    }
}
